[Chapter 12] 12.5 Tools
Author: Cricket Liu & Paul Albitz
Date: 1999-01-06T18:38:39Z

#

| Chapter 12 Reading BIND Debugging Output |

## 12.5 Tools

Let's wrap up a few loose ends. We told you about a tool to convert IP addresses to names so that your debugging output is easier to read. Here is such a tool written in Perl:

>     #!/usr/bin/perl

>     use "Socket.pm";
>     while(< >) {
>       if(/\b)([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\b/) {
>           $addr = pack('C4', split(/\./, $1));
>           ($name, $rest) = gethostbyaddr($addr, &AF_INET);
>           if($name) {s/$1/$name/; }

>         print;
>     }

It's best not to pipe named.run output into this script with debugging on, because the script will generate its own queries to the name server.

If you do any significant amount of name server debugging, you'll want a tool to turn debugging on and off. The 4.9 and later BIND distributions include a tool called `ndc`, which can be used for this purpose. The command `ndc trace` will turn on debugging, or increment the debug level if debugging is already on. The command `ndc notrace` will turn debugging off.

12.4 The Resolver Search Algorithm and Negative Caching |  | 13. Troubleshooting DNS and BIND